﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FlatRedBall.Graphics;
using FlatRedBall.Input;
using FlatRedBall;



namespace TopDownShooter.Screens
{
    public class GameOverScreen : Screen
    {
        public GameOverScreen()
            : base("GameOverScreen")
        {}

        public override void Initialize()
        {
            // Set the screen up here instead of in the Constructor to avoid
            // exceptions occurring during the constructor.


            base.Initialize();
            Text gameOver = TextManager.AddText("GAME OVER MAN!");
            Text restart = TextManager.AddText("Press spacebar to restart");
            Text kills = TextManager.AddText("Kills: " + Game1.kills);
            mTexts.Add(gameOver);
            mTexts.Add(restart);
            mTexts.Add(kills);
            restart.Scale = restart.Spacing = 4;
            gameOver.Scale = gameOver.Spacing = 4;
            kills.Scale = kills.Spacing = 4;

            gameOver.X = -30;
            gameOver.Y = 10;
            restart.Y = 0;
            restart.X = -37;
            kills.X = -37;
            kills.Y = -20;
            

            SpriteManager.Cameras.Clear();
            SpriteManager.Cameras.Add(new Camera(FlatRedBallServices.GlobalContentManager));
            SpriteManager.Camera.X = 0;
            SpriteManager.Camera.Y = 0;
            SpriteManager.Camera.Z = 100;
        }

        public override void Activity(bool firstTimeCalled)
        {
            if (InputManager.Keyboard.KeyPushed(Microsoft.Xna.Framework.Input.Keys.Space))
            {
                Game1.kills = 0;
                MoveToScreen(typeof(GameScreen).FullName);
            }
            base.Activity(firstTimeCalled);
        }

        public override void Destroy()
        {
            base.Destroy();
        }
    }
}
